package com.ruoyi.tea.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.tea.domain.TeaRoom;
import com.ruoyi.tea.domain.TeaUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.tea.mapper.TeaFollowRoomMapper;
import com.ruoyi.tea.domain.TeaFollowRoom;
import com.ruoyi.tea.service.ITeaFollowRoomService;
import com.ruoyi.common.core.text.Convert;

/**
 * 用户关注主播记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-07-31
 */
@Service
public class TeaFollowRoomServiceImpl implements ITeaFollowRoomService 
{
    @Autowired
    private TeaFollowRoomMapper teaFollowRoomMapper;

    /**
     * 查询用户关注主播记录
     * 
     * @param id 用户关注主播记录主键
     * @return 用户关注主播记录
     */
    @Override
    public TeaFollowRoom selectTeaFollowRoomById(Long id)
    {
        return teaFollowRoomMapper.selectTeaFollowRoomById(id);
    }

    /**
     * 查询用户关注主播记录列表
     * 
     * @param teaFollowRoom 用户关注主播记录
     * @return 用户关注主播记录
     */
    @Override
    public List<TeaFollowRoom> selectTeaFollowRoomList(TeaFollowRoom teaFollowRoom)
    {
        return teaFollowRoomMapper.selectTeaFollowRoomList(teaFollowRoom);
    }

    @Override
    public List<TeaRoom> selectTeaFollowRoomApiList(TeaFollowRoom teaFollowRoom) {
        return teaFollowRoomMapper.selectTeaFollowRoomApiList(teaFollowRoom);
    }

    /**
     * 新增用户关注主播记录
     * 
     * @param teaFollowRoom 用户关注主播记录
     * @return 结果
     */
    @Override
    public int insertTeaFollowRoom(TeaFollowRoom teaFollowRoom)
    {
        teaFollowRoom.setCreateTime(DateUtils.getNowDate());
        return teaFollowRoomMapper.insertTeaFollowRoom(teaFollowRoom);
    }

    /**
     * 修改用户关注主播记录
     * 
     * @param teaFollowRoom 用户关注主播记录
     * @return 结果
     */
    @Override
    public int updateTeaFollowRoom(TeaFollowRoom teaFollowRoom)
    {
        return teaFollowRoomMapper.updateTeaFollowRoom(teaFollowRoom);
    }

    /**
     * 批量删除用户关注主播记录
     * 
     * @param ids 需要删除的用户关注主播记录主键
     * @return 结果
     */
    @Override
    public int deleteTeaFollowRoomByIds(String ids)
    {
        return teaFollowRoomMapper.deleteTeaFollowRoomByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除用户关注主播记录信息
     * 
     * @param id 用户关注主播记录主键
     * @return 结果
     */
    @Override
    public int deleteTeaFollowRoomById(Long id)
    {
        return teaFollowRoomMapper.deleteTeaFollowRoomById(id);
    }

    /**
     * 个人关注数量
     * @param teaUser
     * @return
     */
    @Override
    public int followNumber(TeaUser teaUser) {
        return teaFollowRoomMapper.followNumber(teaUser);
    }
}
